package com.liu.test0303.activemq;


import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

/**
 * @author xianguang
 * @date 2020-03-04 11:00
 */
@Component
public class QueueConsumerListener
{
    //queue模式的消费者
    @JmsListener(destination="${spring.activemq.queue-name}", containerFactory="queueListener")
    public void readActiveQueue(String message) {
        System.out.println("queue接受到：" + message);
    }

    //queue模式的消费者
    @JmsListener(destination="${spring.activemq.queue-name2}", containerFactory="queueListener")
    public void readActiveQueue2(String message) {
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(message+"发送邮件成功");
    }





}